﻿using System.Linq;
using Trentacular.SharePoint.Deployment.Model;
using Trentacular.SharePoint.Deployment.Util;

namespace Trentacular.SharePoint.Deployment.Data.Proxy
{
    public class WebApplicationAvailableFeatureDefinitionsLazyInitializer : BaseDomainListLazyInitializer<WebApplication, FeatureDefinition>
    {
        protected override object InitializeTarget()
        {
            return Owner.DeployedSolutions
                .SelectMany(s => s.FeatureDefinitions)
                .ToVirtualList();
        }
    }
}
